#if !defined PROCESSOR
#define PROCESSOR

#include "cv.h"

class Processor 
{

  private:

	  // private attributes

  public:

	  // empty constructor
	  Processor() 
	  { 

		  // default parameter initialization here
	  }

	  // Add here all getters and setters for the parameters

	  // to check if an initialization is required
	  virtual bool isInitialized(IplImage *image)=0;

	  // for all memory allocation
	  virtual void initialize(IplImage *image)=0;   

	  // the processing of the image
	  virtual void process(IplImage *image)=0;

	  // the method that checks for initilization
	  // and then process the image
	  inline void processImage(IplImage *image) 
	  {

		  if (!isInitialized(image)) 
		  {

			  initialize(image);
		  }

		  process(image);
	  }

	  // memory de-allocation
	  virtual void release() =0;

	  ~Processor() 
	  {

		  release();
	  }
};

#endif
